package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name = "张三";
        int age =25;
        String gender="男";
        String[]otherInfo={"是一名杀手","北京的","喜欢打篮球"};
        Student zc=new Student(name,age,gender,otherInfo);
        System.out.println(zc);
        FileOutputStream fos=new FileOutputStream("student.obj");
        ObjectOutputStream oos= new ObjectOutputStream(fos);
        oos.writeObject(zc);
        System.out.println("写入完毕");
        oos.close();


    }

}
